package com.hg.library.graph;

import android.content.Context;
import android.graphics.Typeface;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by ASUS-PC on 2016/4/20.
 */
public class Fonts {

    public static Context context;

    public static final int LAN_TING_HEI = 0;

    public static void init(Context context){
        Fonts.context = context;
    }

    public static Map<Integer,Typeface> typefaceMap = new HashMap<>();

    public static Typeface getFont(int type){
        switch (type){
            case LAN_TING_HEI:
                Typeface typeface1 = typefaceMap.get(LAN_TING_HEI);
                if (typeface1 == null){
                    typeface1 = Typeface.createFromAsset(context.getAssets(), "fonts/lan_ting_hei.TTF");
                    typefaceMap.put(type,typeface1);
                    return typeface1;
                }
                return typeface1;
        }
        return null;
    }
}
